1. Field of the Invention
The present invention is directed to decreasing the start-up time of a computer application in a runtime environment.
2. Description of the Related Art
A standard design goal in computer applications is optimal performance. The performance of an application begins with the amount of time the application takes to load into the operating memory of a processing device and prepare for user input. Many applications require time to call methods and functions, and construct objects. This problem occurs in interpreted applications, such as JAVA and other common programming languages, as well as non-interpreted applications.
As generally understood, applications are usually created in a source language. During a compiling process, statements written in the source language are converted into machine language or “code” that a computer's processor uses.
A stored program that is executed on a computer is loaded into the computer memory (from a file system or a communication stream such as an internet connection). The application executes initialization code, which initializes the application's global data. The application also executes code that depends upon external events: user events, network events, or stored data separate from the stored data of the application.
The period of time between the command to initiate the program, and the time at which the program commencing processing to external events, depends upon both the time it takes to load the program into memory and the time that it takes to execute initialization code. Any technique that reduces the amount of time spent executing initialization code will decrease the amount of time until the application process external events. For an interactive program such as a desktop application or a rich internet application, this decreases the amount of time between the user event that launches the application (opening a file or choosing a program from a menu on a desktop operating system, or clicking on a link or otherwise requesting the URL that links to the application or an HTML page that embeds it), and the period during which the application is responsive to user events. This is particularly important in environments where code execution is slow, such as virtual machines with bytecode interpreters such as older JAVA implementations and such as the FLASH player. In object-oriented programming languages, bytecode can run on any computer system platform for which a virtual machine or bytecode interpreter is provided to convert the bytecode into instructions that can be executed by the actual hardware processor. Using this virtual machine, the bytecode can optionally be recompiled at the execution platform by a just-in-time compiler. Further, computing the initial state of the application can be time consuming because some of the calculations are complex and because values must sometimes be recomputed.
Some applications attempt to improve startup speed by recording an image of the application in a processing device's physical memory, and using that image to start the application in a processing device. A familiar example of this is the Microsoft Windows® operating system's hibernate feature. When enabled, this feature copies everything in a computer's random access memory (RAM) to the hard drive and then shuts down the hardware. When one turns the hardware back on, Windows restores the system to the state it was in when one started hibernation.
Two object oriented programming languages—LISP and SMALLTALK—include the ability to take a similar “snapshot” of their runtime execution. However, in these implementations, the development environment was recorded as well. For example, in the SMALLTALK programming language, the current state of the GNU SMALLTALK virtual machine is saved along with the objects created. While this means that all objects are saved to a file that can be loaded rapidly at a later point in time, the file is large due to the inclusion of the runtime.
In the LISP programming language and the SMALLTALK programming language, snapshots could be generated in a variety of ways: by adding an instruction that reads a file that represents the initial state of memory, by compressing this file using data compression techniques, or by serializing the objects in memory. However, these techniques were used in the context of “code evolution”, where a stored program that is a development environment (compiler, editor, code libraries) for the target language and is written in that same language is extended to contain an in-memory representation of the application as well as the development environment; this in-memory representation is saved to disk using one of the techniques above (serialization, compression, or a raw representation of memory).